{% extends 'course-manage/layout.html.twig' %}

{% block title %}{{ 'course.replay_manage'|trans }} - {{ parent() }}{% endblock %}

{% set course_side_nav = 'replay' %}
{% do script(['app/js/course-manage/live-replay/index.js']) %}

{% block page_title %}{{ 'course.replay_manage.content_title'|trans }}{% endblock %}

{% block main_body %}
  {% if has_permission('admin_v2_course_content_manage') or 'ROLE_TEACHER' in app.user.roles or (courseSet.parentId > 0 and has_permission('admin_v2_classroom')) %}
    <div class="lesson-manage-section">
      {% if tasks is empty %}
        <div class="empty">{{ 'course.replay_manage.empty'|trans }}</div>
      {% endif %}

      <ul class="live-course-lesson sortable-list ml0" id="course-item-list">
        {% for task in tasks %}
          {% include 'course-manage/live-replay/list-item.html.twig' with {course: course, task: task, activity: task.activity, multiClass: multiClass } %}
        {% endfor %}
      </ul>
      <div class="color-warning">{% if course.platform == 'self' %}{{'course.replay_manage.tips'|trans|raw}}{% else %}{{'purchase.course.replay_manage.tips'|trans|raw}}{% endif %}</div>
    </div>
  {% else %}
    <div class="cd-alert cd-alert-danger">{{ 'course.replay_manage.no_permission_tips'|trans }}</div>
  {% endif %}
{% endblock %}
